//
//  WMSDKManager.h
//  Pods
//
//  Created by zero on 2021/7/16.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^WMResumeBlock)(BOOL status, NSString *msg, NSDictionary *dicData);

@interface WMSDKManager : NSObject


/// 恢复购买结果回调
@property (nonatomic, copy) WMResumeBlock resumeBlock;


+ (instancetype)sharedManager;


/// 初始化SDK
- (void)setupSDK;


/// 检查本地尚未验证的订单
/// @param block 回调信息
- (void)checkLocalOrderWithBlock:(void(^)(BOOL status, NSString *msg, NSDictionary *localOrder))block;


/// 恢复购买
/// @param block 回调信息
- (void)resumePurchaseWithBlock:(void(^)(BOOL status, NSString *msg, NSArray *resumeArray))block;

    
/// 获取所有的商品信息
/// @param idetifiers 商品ID数字 ex: @[@"id1", @"id2"]
/// @param block 获取回调
- (void)getAllProductsWithIdentifiers:(NSArray *)idetifiers GetBlock:(void(^)(BOOL status, NSString *msg, NSArray *products))block;


/// 开始发起内购
/// @param string 内购ID
/// @param handle 内购结果回调
- (void)startToPayWithProductId:(NSString *)string statusBlock:(void(^)(BOOL status, NSString *msg))handle;

/// 更新本地的金额
/// @param amount 金额
- (void)saveAmount:(NSInteger)amount;

/// 获取本地保存的金额
- (NSInteger)getAmount;

/// 上报消费金额
/// @param amount 消费金额
- (void)recordConsumptionWithAmount:(NSInteger)amount;


/// 记录发货状态
/// @param productId 商品ID
/// @param status 发货状态 YES为已发货
- (void)uploadDeliverGoodsWithProductId:(NSString *)productId Status:(BOOL)status;


/// 上报商品展示
/// @param productId 商品ID
- (void)addProductShowLogWithProductId:(NSString *)productId;


/// 获取版本号
- (NSString *)getVersion;

@end

NS_ASSUME_NONNULL_END
